﻿#pragma once

#include<atomic>
#include<thread>
#include<mutex>

#include"../Visualization/VTKRenderer.h"

/// @brief 控制台的命令行输入控制类
class CommandConsole
{
public:
    CommandConsole(VTKRenderer& renderer);
    ~CommandConsole();

public:
    /// @brief 启动命令循环
    void StartCommandLoop();
    
private:
    /// @brief 停止命令循环
    void StopCommandLoop();

private:
    VTKRenderer&        m_Renderer;                     // 关联的渲染器实例
    std::atomic<bool>   m_CommandLoopRunning{false};    // 命令循环运行标志
    std::thread         m_CommandThread;                // 命令线程
    std::mutex          m_CommandMutex;                 // 命令互斥锁
};